﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Collections.ObjectModel;
using CheckLift.Common.Intf;

namespace CheckLift.Linq
{
    public class ServiceCompanyData : BaseData
    {
        public ObservableCollection<IServiceCompany> GetServiceCompanies()
        {
            var companies = from company in dc.ServiceCompanies
                                                        select company;
            return Convert<IServiceCompany>(companies);
        }

        public IServiceCompany GetServiceCompany(Guid serviceId)
        {
            return (from service_company in dc.ServiceCompanies
                    where service_company.Id == serviceId
                    select service_company).FirstOrDefault<IServiceCompany>();
        }
    }
}
